-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added tests for service file in pkg/estimator/client #5427
Added tests for service file in pkg/estimator/client #5427
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5427 +/- ##
==========================================
- Coverage 31.05% 30.90% -0.16%
==========================================
Files 639 639
Lines 44313 44343 +30
==========================================
- Hits 13763 13703 -60
- Misses 29556 29661 +105
+ Partials 994 979 -15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@XiShanYongYe-Chang please help review this pr |
pkg/estimator/client/service_test.go
Outdated
@@ -0,0 +1,200 @@ | |||
/* | |||
Copyright 2022 The Karmada Authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@XiShanYongYe-Chang fixed the required changes .
ktesting "k8s.io/client-go/testing" | ||
) | ||
|
||
func TestResolveCluster(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about writing the test function using a table drive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sure , we can look into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@XiShanYongYe-Chang i have pushed the latest commits , we can process with review now !
/assign |
377a3f1
to
826c0fd
Compare
Signed-off-by: Yash Pandey <[email protected]>
826c0fd
to
ec41958
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks~
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: XiShanYongYe-Chang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
Added unit tests for service file in
pkg/estimator/client
/kind failing-test
What this PR does / why we need it:
This PR introduces unit tests for the
resolveCluster
andfindServicePort
functions in thepkg/estimator/client
package. These tests aim to cover various scenarios including handling ofExternalName
services, port mismatches, and errors related to service port types. This ensures better test coverage and reliability of the service handling logic.Which issue(s) this PR fixes:
Fixes issue with incomplete test coverage for service handling in the
pkg/estimator/client
package.Fixes part of : #5235
Does this PR introduce a user-facing change?: